<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../js/vue.js"></script>
</head>

<body>
  <div id="app">
    <my-com :level="2">
      <p>你好render函数</p>
    </my-com>
  </div>
  <script>
    // 组件的全局注册
    Vue.component('myCom', {
      props: {
        level: {
          type: Number,
          required: true
        }
      },
      render(createElement) {
        // return createElement(
        //   'h' + this.level,
        //   {
        //     class: 'header'
        //   },
        //   this.$slots.default
        // )
        return (<div>你好</div>)
      }
    })
    let vm = new Vue({
      el: "#app",
      data: {

      },
      methods: {

      },
      created() {

      }
    })
  </script>
</body>

</html>